window.onload=function(){
    let smallBox = document.querySelector('.smallBox');
    let box = document.querySelector('.box');
    let box1 = document.querySelector('.box1');
    let img2 = document.querySelector('#img2');
    box.addEventListener('mousemove',function(e){
       let x = e.offsetX - smallBox.offsetWidth/2;
       let y = e.offsetY - smallBox.offsetHeight/2;
       smallBox.style.transform = `translate(${x}px,${y}px)`;
       let left =e.offsetX-img2.clientWidth/2;
       let top = e.offsetY-img2.clientHeight/2;
       img2.style.left = -left+'px';
       img2.style.top=-top+'px'; 
    })
}